package cn.hxh.jetty;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;

public class JettyLauncher {

	public static void main(String[] args) throws Exception {
		Server server = new Server(8080);

		ServletContextHandler context = new ServletContextHandler(
				ServletContextHandler.SESSIONS);
		context.setContextPath("/");
		server.setHandler(context);

		context.addServlet(new ServletHolder(new HelloWorldServlet()), "/*");
		context.addServlet(new ServletHolder(new HelloWorldServlet("大家好")),
				"/it/*");
		context.addServlet(new ServletHolder(new HelloWorldServlet("hello!")),
				"/fr/*");

		server.start();
		server.join();
	}

}
